﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BugTracker.BusinessLogic.BTUser
{
    public class BTUserMapper : IBTUserMapper
    {
        #region IBTUserMapper Members

        public DataAccess.Data.BTUser Map(BusinessEntities.Entities.BTUser.BTUser value)
        {
            DataAccess.Data.BTUser result = new DataAccess.Data.BTUser();
            result.BTUserID = value.BTUserID;
            result.UserId = value.UserId;
            result.FirstName = value.FirstName;
            result.LastName = value.LastName;
            result.WorkPhone = value.WorkPhone;
            result.MobilePhone = value.MobilePhone;
            result.Email = value.Email;
            result.Detail = value.Detail;
            result.IsActive = value.IsActive;
            result.IsDeleted = value.IsDeleted;
            result.RowGuid = value.RowGuid;
            result.CreatedOn = value.CreatedOn;
            result.ModifiedOn = value.ModifiedOn;
            return result;
        }

        public BusinessEntities.Entities.BTUser.BTUser Map(DataAccess.Data.BTUser value)
        {
            BusinessEntities.Entities.BTUser.BTUser result = 
                new BusinessEntities.Entities.BTUser.BTUser();
            result.BTUserID = value.BTUserID;
            result.UserId = value.UserId;
            result.FirstName = value.FirstName;
            result.LastName = value.LastName;
            result.WorkPhone = value.WorkPhone;
            result.MobilePhone = value.MobilePhone;
            result.Email = value.Email;
            result.Detail = value.Detail;
            result.IsActive = value.IsActive;
            result.IsDeleted = value.IsDeleted;
            result.RowGuid = value.RowGuid;
            result.CreatedOn = value.CreatedOn;
            result.ModifiedOn = value.ModifiedOn;
            return result;
        }

        public void Map(DataAccess.Data.BTUser result, BusinessEntities.Entities.BTUser.BTUser value, bool includeKey = false)
        {
            if (includeKey)
            {
                value.BTUserID = result.BTUserID;
            }
            result.UserId = value.UserId;
            result.FirstName = value.FirstName;
            result.LastName = value.LastName;
            result.WorkPhone = value.WorkPhone;
            result.MobilePhone = value.MobilePhone;
            result.Email = value.Email;
            result.Detail = value.Detail;
            value.IsActive = result.IsActive;
            value.IsDeleted = result.IsDeleted;
            value.RowGuid = result.RowGuid;
            value.CreatedOn = result.CreatedOn;
            value.ModifiedOn = result.ModifiedOn;
        }

        public void Map(BusinessEntities.Entities.BTUser.BTUser result, DataAccess.Data.BTUser value, bool includeKey = false)
        {
            if (includeKey)
            {
                value.BTUserID = result.BTUserID;
            }
            result.UserId = value.UserId;
            result.FirstName = value.FirstName;
            result.LastName = value.LastName;
            result.WorkPhone = value.WorkPhone;
            result.MobilePhone = value.MobilePhone;
            result.Email = value.Email;
            result.Detail = value.Detail;
            value.IsActive = result.IsActive;
            value.IsDeleted = result.IsDeleted;
            value.RowGuid = result.RowGuid;
            value.CreatedOn = result.CreatedOn;
            value.ModifiedOn = result.ModifiedOn;
        }

        #endregion
    }
}
